import {Injectable} from "@nestjs/common";
import {StaffTagSaveDto} from "~/modules/consult/tag/tag.dto";
import {InjectRepository} from "@nestjs/typeorm";
import {StaffTagEntity} from "~/modules/consult/tag/tag.entity";
import {Repository} from "typeorm";

@Injectable()
export class StaffTagService {
  @InjectRepository(StaffTagEntity)
  private readonly staffTagRepository: Repository<StaffTagEntity>

  async save(staffTagSaveDto: StaffTagSaveDto) {
    const staffTag = new StaffTagEntity()
    staffTag.name = staffTagSaveDto.name
    staffTag.description = staffTagSaveDto.description
    staffTag.status = staffTagSaveDto.status


    return await this.staffTagRepository.save(staffTag)
  }

  async remove(id: number) {
    await this.staffTagRepository.delete(id)
  }

  async find() {
    return await this.staffTagRepository.find()
  }
}
